﻿using System;
using System.Collections.Generic;
using Studio;
using UnityEngine;

namespace SceneAssist
{
	// Token: 0x02000517 RID: 1303
	public class ItemHolder : MonoBehaviour
	{
		// Token: 0x170003E5 RID: 997
		// (get) Token: 0x06002126 RID: 8486 RVA: 0x000CBAC0 File Offset: 0x000C9CC0
		// (set) Token: 0x06002127 RID: 8487 RVA: 0x000CBAC8 File Offset: 0x000C9CC8
		public ChaControl CharFemale { get; private set; }

		// Token: 0x170003E6 RID: 998
		// (get) Token: 0x06002128 RID: 8488 RVA: 0x000CBAD4 File Offset: 0x000C9CD4
		public AnimatorStateInfo NowState
		{
			get
			{
				return this.CharFemale.GetAnimatorStateInfo(0);
			}
		}

		// Token: 0x06002129 RID: 8489 RVA: 0x000CBAE4 File Offset: 0x000C9CE4
		public void PlayAnime(string _name, int _layer = 0)
		{
		}

		// Token: 0x0600212A RID: 8490 RVA: 0x000CBAE8 File Offset: 0x000C9CE8
		public bool LoadItem(string _asset, string _file, string _parent)
		{
			return true;
		}

		// Token: 0x0600212B RID: 8491 RVA: 0x000CBAEC File Offset: 0x000C9CEC
		public void ReleaseItem(string _name)
		{
			int num = this.listItem.FindIndex((GameObject o) => o.name == _name);
			if (num < 0)
			{
				return;
			}
			GameObject obj = this.listItem[num];
			UnityEngine.Object.Destroy(obj);
			this.listItem.RemoveAt(num);
		}

		// Token: 0x0600212C RID: 8492 RVA: 0x000CBB48 File Offset: 0x000C9D48
		public void ReleaseAllItem()
		{
			if (this.listItem == null)
			{
				return;
			}
			for (int i = 0; i < this.listItem.Count; i++)
			{
				if (this.listItem[i] != null)
				{
					UnityEngine.Object.Destroy(this.listItem[i]);
				}
			}
			this.listItem.Clear();
		}

		// Token: 0x0600212D RID: 8493 RVA: 0x000CBBB0 File Offset: 0x000C9DB0
		public void SetVisible(bool _visible)
		{
			for (int i = 0; i < this.listItem.Count; i++)
			{
				if (!(this.listItem[i] == null))
				{
					if (this.listItem[i].activeSelf != _visible)
					{
						this.listItem[i].SetActive(_visible);
					}
				}
			}
		}

		// Token: 0x0600212E RID: 8494 RVA: 0x000CBC20 File Offset: 0x000C9E20
		private void Awake()
		{
			this.CharFemale = base.GetComponent<ChaControl>();
		}

		// Token: 0x0600212F RID: 8495 RVA: 0x000CBC30 File Offset: 0x000C9E30
		private void OnDestroy()
		{
			this.ReleaseAllItem();
		}

		// Token: 0x040022B0 RID: 8880
		public List<GameObject> listItem = new List<GameObject>();
	}
}
